<!DOCTYPE html>
<html>

{include file='public/header'}
<style>
    .layui-input-block{
        margin-left: 75px;
    }
</style>
<body>
    <div class="x-nav">
        <span class="layui-breadcrumb">
            <a href="javascript:void(0)">首页</a>
            <a href="javascript:void(0)">短剧管理</a>
            <a><cite>短剧统计</cite></a>
        </span>
        <a class="layui-btn layui-btn-small" id="reload" title="刷新">
            <i class="layui-icon" style="line-height:30px"><i class="iconfont">&#xe6aa;</i></i>
        </a>
    </div>
    <div class="x-body">
        <div class="layui-row">
            <form class="layui-form">
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">短剧ID：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="id" placeholder="请输入短剧ID" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">短剧名称：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="name" placeholder="请输入短剧名称" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">分类：</label>
                    <div id="pMenu"></div>
                </div>
                <button class="layui-btn" style="margin-left: 10px;" lay-submit lay-filter="searchList">搜索</button>
                <button type="reset" id="resetList" class="layui-btn layui-btn-primary">重置</button>
            </form>
            <!-- <table id="launchDataList" lay-filter="launchDataList"></table> -->
        </div>
        <table id="statictics" lay-filter="statictics"></table>
    </div>
    <script type="text/html" id="tbBar">
        <a class="layui-btn layui-btn-xs" lay-event="look">查看详情</a>
    </script>
    <script>
        let params = {
            elem: '#statictics'
            , url: '/admin/video/statisticsList' //数据接口
            , id: 'statictics'
            , page:true
            , limit: 10
            , cols: [[ //表头
                { field: 'id', title: 'ID', width: 80, sort: true, align:'center' }
                , { field: 'name', title: '名称', align:'center' }
                , { field: 'video_type_name', title: '分类名称', align:'center' }
                , { field: 'frequency', title: '播放次数', align:'center' }
                , { field: 'number', title: '播放人数', align:'center'}
                , { field: 'today_consume', title: '今日消费（K币）', align:'center'}
                , { field: 'yesterday_consume', title: '昨日消费（K币）', align:'center'}
                , { field: 'total_consume', title: '总消费（K币）', align:'center'}
                , { field: 'today_recharge', title: '今日充值', align:'center'}
                , { field: 'yesterday_recharge', title: '昨日充值', align:'center'}
                , { field: 'total_recharge', title: '总充值', align:'center'}
                , { toolbar: '#tbBar', title: '操作', align: 'center', width: 120}
            ]]
        }
        tableList(params)
        let selectParams = {
            url:'/admin/type/select',
            elem: '#pMenu',
            selected: [],
            tips: '选择分类',
            name: 'video_type_id',
            field_id:'id',
            field_Name:'name',
        }
        selectN(selectParams)

        layui.use('table', function () {
            var table = layui.table;
            table.on('tool(statictics)', function (obj) {
                var event = obj.event;
                if (event === 'look') {
                    x_admin_show('查看', `./statisticsInfo.html?id=${obj.data.id}&name=${obj.data.name}`, 1400, 730, null);
                }
            });
        });
    </script>
</body>

</html>